/*    */ package com.ui;
/*    */ 
/*    */ import com.engine.Client;
/*    */ import com.engine.IConnect;
/*    */ import com.engine.IRecv;
/*    */ import com.engine.ReadConfig;
/*    */ import java.io.FileNotFoundException;
/*    */ import java.io.IOException;
/*    */ import org.apache.log4j.Category;
/*    */ 
/*    */ public class LCDProps
/*    */   implements Runnable, IRecv
/*    */ {
/* 13 */   static final Category log = Category.getInstance(LCDProps.class);
/*    */   private Client lcd;
/*    */   private String hostname;
/*    */   private int port;
/*    */   public static IRecv LCD;
/*    */ 
/*    */   public LCDProps()
/*    */     throws FileNotFoundException, IOException
/*    */   {
/* 20 */     this.lcd = new Client();
/* 21 */     ReadConfig.getInstance(null);
/* 22 */     this.hostname = ReadConfig.GET("LCD_IP_CONFIG");
/* 23 */     this.port = Integer.parseInt(ReadConfig.GET("LCD_PORT"));
/* 24 */     new Thread(this).start();
/* 25 */     LCD = this;
/*    */   }
/*    */ 
/*    */   public void run()
/*    */   {
/* 30 */     while (!this.lcd.isConnected())
/*    */     {
/*    */       try {
/* 33 */         log.info("connect to: " + this.hostname + ":" + this.port);
/* 34 */         this.lcd.connect(this.hostname, this.port);
/* 35 */         if (this.lcd.isConnected())
/*    */         {
/* 37 */           SQUI.App1.connect(0);
/*    */         }
/*    */         else
/*    */         {
/* 41 */           SQUI.App1.disconnect(0);
/*    */         }
/*    */       }
/*    */       catch (IOException e) {
/* 45 */         SQUI.App1.disconnect(0);
/*    */       }
/*    */       try {
/* 48 */         Thread.sleep(5000L);
/*    */       }
/*    */       catch (InterruptedException e) {
/* 51 */         e.printStackTrace();
/*    */       }
/*    */     }
/* 54 */     SQUI.App1.disconnect(0);
/* 55 */     this.lcd.disconnect();
/* 56 */     new Thread(this).start();
/*    */   }
/*    */ 
/*    */   public void recv(String data)
/*    */   {
/*    */     try {
/* 62 */       SQUI.App.writeLogLCD("SEND TO LCD: " + data);
/* 63 */       this.lcd.sendMessage(data);
/*    */     }
/*    */     catch (IOException e) {
/* 66 */       log.info(e.getLocalizedMessage());
/*    */     }
/*    */   }
/*    */ 
/*    */   public void counter(int idx, String value)
/*    */   {
/*    */   }
/*    */ 
/*    */   public void displayTickerCounter(int idx)
/*    */   {
/*    */   }
/*    */ 
/*    */   public void writeLog(String msg)
/*    */   {
/*    */   }
/*    */ 
/*    */   public void writeLogRecv(String msg)
/*    */   {
/*    */   }
/*    */ 
/*    */   public void writeLogLCD(String msg)
/*    */   {
/*    */   }
/*    */ }

/* Location:           F:\16 2\SQ.jar
 * Qualified Name:     com.ui.LCDProps
 * JD-Core Version:    0.6.0
 */